<template>
	<view class="searchPar">
		<view class="iconfont icon-fanhui" v-if="fromPage == 'livePage'" @tap="goBack"></view>
		<view class="searchInp zxSearch alignCen posRel" @tap="goSearch">
			<view class="iconfont icon-sousuo"></view>
			<template v-if="fromPage == 'zxsList'">
				<text class="searchTips" :class="searchTxt == '请输入咨询师姓名' ? '' : 'hasKeyWord'">{{searchTxt}}</text>
				<view v-if="searchTxt != '请输入咨询师姓名'" class="iconfont icon-shanchu posAbso" @tap.stop="delSearchTxt"></view>
			</template>
			<template v-if="fromPage == 'ddsList'">
				<text class="searchTips" :class="searchTxt == '请输入督导师姓名' ? '' : 'hasKeyWord'">{{searchTxt}}</text>
				<view v-if="searchTxt != '请输入督导师姓名'" class="iconfont icon-shanchu posAbso" @tap.stop="delSearchTxt"></view>
			</template>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			searchTxt:String,
			fromPage:{
				type:String,
				default:'zxsList'
			}
		},
		data(){
			return{
				cartNum:0
			}
		},
		methods:{
			goBack(){
				this.$emit('goBack');
			},
			goSearch(){
				this.$emit('goSearch')
			},
			delSearchTxt(){
				this.$emit('delSearchTxt')
			}
		}
	}
</script>

<style lang='scss' scoped>
	@import '@/static/scss/search.scss';
	.searchTips.hasKeyWord{
		color: $pss-text-color3;
	}
	.icon-shanchu{
		height: 70rpx;
		padding-left: 80rpx;
		line-height: 70rpx;
		color: $pss-text-color3;
		font-size:36rpx;
		right: 30rpx;
		top: 0;
	}
</style>